The present invention relates to a storage system for storing data to be used by a computer and having data updated by a computer and more particularly to remote copy processing in which copies of data are held among plural storage systems.
EP 0672985 discloses a remote copy system for storing data to be used by a computer in a primary storage system and storing a copy of the data in a remote secondary storage system. In EP 0672985, copies of data are stored in the secondary storage system in the same writing order as that of storing the data in the primary storage system.
In EP 0672985, the primary storage system having received write data from a primary host computer reports the completion of reception of the write data to the primary host computer immediately after the reception of the write data. Then, the primary host computer reads a copy of the write data from the primary storage system. A write time is given to the write data. In this case, the write time is a time when a write request is issued for the write data. When the write data is loaded to the primary host computer, the write time is sent to the primary host computer. Furthermore, the primary host computer transfers the write data and the write time to a secondary host computer. The secondary host computer having received the write data and the write time writes the information including the write time in a control volume in the secondary storage system and writes respective write data in the secondary storage system in an order of write times with reference to write times given to the write data. By writing write data in the secondary storage system in an order of write times, the secondary storage system can always hold consistent data.
When write data is stored in the storage system in defiance of writing order, the end of a transaction cannot be identified in database processing, for example, which is a problem. In database processing, log data is first written in a storage system before data is written in the storage system. The log data includes information indicating the end of the transaction. Thus, when an error occurs before one transaction completes, a host computer can recover data to the state at the completion of the transaction with reference to the log data written in the storage system. However, when write data is stored in a storage system in defiance of writing order, data may be written in the storage system before the log data is written in the storage system. When an error occurs in the middle of a transaction under this condition, the host computer cannot process data having written until the middle of the transaction since the storage system does not hold the log data corresponding to the data. Thus, an in-progress result of the transaction remains in the storage system. Data having such an in-progress result of the transaction cannot be continuously used for sequent database processing.
As an example that an in-progress result of a transaction remains in a storage system, processing for transferring a deposit from Bank Account A to Bank Account B will be considered below. In this case, decreasing an amount in Account A and increasing an amount in Account B must be executed as one transaction. However, when an error occurs after increasing the amount of Account B (that is, after writing the balance after the increasing the amount of Account B) and before decreasing the amount of Account A (that is, before writing the balance after decreasing the amount of Account A), a period occurs in which the amount of the deposit in Account B is increased before the amount of deposit of Account A is decreased. In this case, when the log data is stored in a storage system thereof in advance, the host computer can recover data with reference to the log data. On the other hand, when the log data is not stored in a storage system thereof, the database processing cannot be recovered and inconsistent data remains in the storage system.
Similarly in a remote copy system, a failure may occur in a primary storage system and the primary storage system cannot be used after increasing the amount of Account B and before decreasing the deposit amount of Account A, an in-progress result of the transaction remains in a secondary storage system. In this case, when log data is not stored in the secondary storage system, improper processing is executed even though a secondary host computer takes over the transaction after that. Therefore, by holding consistent data in writing order, the validity of an order of related operations can be assured for related data thereof like the relationship between log data and data in database processing.
U.S. Pat. No. 6,092,066 discloses a technology by which data to be used by a computer is stored in a storage system and the storage system copies the data to another remote storage system so that the data can be held even when one storage system is unavailable due to a natural disaster or a fire.